<?php
class Log{

	public static function Write($content,$type,$gz=false){
		Log::logger($type."-".date('Ymd').".log",$content,"DEFAULT",$gz);
	}
	
	private static function logger($log_filename,$log_content,$prefix="",$gzf){
		
		if($prefix=="DEFAULT")$prefix="--".date('Y年m月d日 H时i分s秒').":\r\n";
		$suffix="\n";//for all
		if($gzf){
			$gz = gzopen(_PATH_.'/Data/Log/'.$log_filename .'.gz','a');
			gzwrite($gz, $prefix.$log_content.$suffix);
			gzclose($gz);
		}else{
			file_put_contents(_PATH_.'/Data/Log/'.$log_filename, $prefix.$log_content.$suffix, FILE_APPEND);
		}
	}
}